
const routes = [
  {
    name: 'home',
    path: '/home',
    component: ()=>{return import('@/pages/Home')},
    meta: {
      isShowNav: true
    }
  },
  {
    name: 'login',
    path: '/login',
    component: ()=> import('@/pages/Login'),
    meta: {
      isShowFotter: true // 路由元信息，来添加自定义的属性存储一些信息等等
    }
  },
  {
    name: 'register',
    path: '/register',
    component: ()=> import('@/pages/Register'),
    meta: {
      isShowFotter: true
    }
  },
  {
    name: 'search',
    path: '/search/:keyword?',
    component: ()=> import('@/pages/Search')
    
  },
  {
    name: 'detail',
    path: '/detail/:id',
    component: ()=> import('@/pages/Detail'),
    props: true // 添加了这一行代码，会将之前传入的params参数直接用props来接收
  },
  {
    name: 'addcartsuccess',
    path: '/addcartsuccess',
    component: ()=> import('@/pages/AddCartSuccess'),
    
  },
  {
    name: 'shopcart',
    path: '/shopcart',
    component: ()=> import('@/pages/ShopCart'),
    
  },
  {
    // 结算界面
    name: 'trade',
    path: '/trade',
    component: ()=> import('@/pages/Trade')
  },
  {
    // 付款界面
    path: '/pay',
    component: ()=> import('@/pages/Pay'),
    name: 'pay'
  },
  {
    // 支付成功界面
    path: '/paysuccess',
    component: ()=> import('@/pages/PaySuccess'),
    name: 'paysuccess'
  },
  {
    // 购物清单界面
    path: '/center',
    component: ()=> import('@/pages/Center'),
    name: 'center'
  },
  {
    path: '/',
    redirect: '/home' // 重定向
  }
];
export default routes;
